#include <QCoreApplication>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int n;
    float i, sum = 0;
    do
    {
        printf("\nVvedite chislo: ");
        scanf("%d", &n);
        if(n<=0) printf("  Error enter!");
    }while(n<=0);

    for(i=1; i<=n; i++)
        sum= sum + (1/i);
        printf("\nsumma = %f", sum);

    return 0;
}
